package whatver.hello;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class HelloWorld2Activity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
       
        Button a = (Button) findViewById(R.id.button1);
        a.setText("Press");
        a.setOnClickListener(new View.OnClickListener(){

			public void onClick(View v) {
				// TODO Auto-generated method stub
				
				Button a = (Button) findViewById(R.id.button1);
				System.out.println(a.getText());
				String str = (String)a.getText();
				if (str.equals("Press")){
					a.setText("Pressed");
				}
				if (str.equals("Pressed")){
					a.setText("Press");
				}
			}
        	
        });
        
    }
}